
var hour = $('.hour1');
var min = $('.min1');
var sec = $('.sec1');
var timer;
//结束时间
var end = new Date('2016/10/01/ 00:00:00');

timer = setInterval(clock,1000)
function clock(){
	var now = new Date();
	var time = parseInt((end- now)/1000);
	if(time>0){
		var s = time%60;
		var m = parseInt(time/60)%60;
		var h = parseInt(time/3600)%24;
		if(h<10){
			hour.html('0'+h)
		}else{
			hour.html(h)
		}
		if(m<10){
			min.html('0'+m);
		}else{
			min.html(m);
		}
		
		if(s<10){
			sec.html('0'+s);
		}else{
			sec.html(s);
		}
		
	}else{
		hour.html('00');
		min.html('00');
		sec.html('00');
		clearInterval(timer);
	}
}